import { request } from '@/utils/hsj/service/index'

// 查询工单类型列表
export function listWorkOrderCategory(query) {
  return request({
    url: '/system/workOrderCategory/list',
    method: 'get',
    params: query,
  })
}

// 查询工单类型列表（排除节点）
export function listWorkOrderCategoryExcludeChild(workOrderCategoryId) {
  return request({
    url: '/system/workOrderCategory/list/exclude/' + workOrderCategoryId,
    method: 'get',
  })
}

// 查询工单类型详细
export function getWorkOrderCategory(workOrderCategoryId) {
  return request({
    url: '/system/workOrderCategory/' + workOrderCategoryId,
    method: 'get',
  })
}

// 新增工单类型
export function addWorkOrderCategory(data) {
  return request({
    url: '/system/workOrderCategory',
    method: 'post',
    data: data,
  })
}

// 修改工单类型
export function updateWorkOrderCategory(data) {
  return request({
    url: '/system/workOrderCategory',
    method: 'put',
    data: data,
  })
}

// 删除工单类型
export function del(workOrderCategoryId) {
  return request({
    url: '/system/workOrderCategory/' + workOrderCategoryId,
    method: 'delete',
  })
}

// 查询工单类型下拉树结构
export function workOrderCategoryTreeSelect() {
  return request({
    url: '/system/workOrderCategory/workOrderCategoryTree',
    method: 'get',
  })
}
